1. Field of the Invention
The present invention pertains to an image processing device that compresses and codes image information using the GBTC (Generalized Block Truncation Coding) method.
2. Description of the Related Art
The GBTC method has been proposed in recent years as a method to compress and expand document image data. Under the GBTC method, the document image data is divided into blocks, each of which has a prescribed number of pixels, and data compression is carried out for each block. Specifically, the data for each pixel in the block is quantized into fewer gradation levels using average value information LA and gradation range index LD calculated from the image data for the block. In other words, the image data for each pixel is converted into coded data .PHI.ij obtained through said quantization and the amount of information consequently becomes compressed. Average value information LA is obtained by dividing into two equal parts the sum of average value Q1 of image data values equal to or lower than parameter P1 and average value Q4 of image data values equal to or larger than parameter P2 (P1&lt;P2), said parameters being determined depending on the image data for the block. Gradation range index LD is the difference between average value Q4 and average value Q1.
FIG. 1 is a drawing to explain the general flow of the coding process using the GBTC method. First, as shown in FIG. 1(a), the document image data is divided into blocks each comprising 4.times.4 pixels. Image data is then extracted from each block. The extracted image data for each block is coded using the GBTC method. Image data for a pixel has a data amount of one byte (=8 bits=256 gradations). In this GBTC coding process, the data for the 16 pixels of the block (1 [8 bits].times.16 bytes=128 bits) is coded (compressed) into one-byte for a gradation range index LD, one-byte for an average value information LA and four-bytes of coded data. The four-bytes of coded data is obtained by classifying and allocating data for each pixel into one of four levels (quantization). In other words, the entire block ends up having four-bytes of coded data because each of the 16 pixels has 2-bits of coded data.
Consequently, the image data for one block (16 bytes) is coded into six-bytes of (48-bits) data. In other words, the amount of image data is compressed to three-eighths of what it was prior to compression.
FIG. 1(c) indicates that the amount of compressed, i.e., coded, image data for one block is equivalent to image data for six pixels prior to compression. The coded data is decoded by calculating, based on gradation range index LD and average value information LA, and image data (1 byte) that corresponds to the coded data (2 bits).
The image data for each of the 16 pixels Xij (i, j=1, 2, 3, 4) in the 4.times.4 pixel block is converted through the decoding process into one of four levels of data (1 byte) out of the 256 gradations. Here, the decoded data clearly includes an error in comparison with the original image data. However, this error is negligible due to the nature of human vision. In other words, there is little image deterioration as far as regular images are concerned.
Parameters Q1 and Q4 can be obtained from gradation range index LD and average value information LA included in the coded data. In other words, a letter image comprising black areas equal to or smaller than parameter P1 and white areas equal to or larger than parameter P2 can be reproduced from the coded data.
In the JPEG (Joint Photographic Experts Group) method in which data obtained through DCT (discrete cosine transform) conversion of image data is converted into Huffman codes, the rate of data compression varies depending on the type of the document. In other words, with some documents, higher data compression takes place in the JPEG method than in the GBTC method, but with others, there are cases where very little compression is possible using the JPEG method. Therefore, it is difficult to set the capacity of the image processing device's built-in memory using the JPEG method. On the other hand, using the GBTC method, data compression is available at a constant compression rate at all times. Therefore, it is easy to set the capacity of the image processing device's built-in memory using the GBTC method.
In an image processing device in which coding is performed using the JPEG method, DCT conversion of the document image data takes place with a block comprising a certain pixel matrix as one unit. Unlike average value information LA, gradation range index LD and coded data .PHI.ij that can be obtained through the GBTC coding process, the DCT-converted data is not data that reflects the average value or gradation range of the data for pixels comprising the block. Therefore, even if the DCT-converted data is processed, the density and color balance of the reproduced image cannot be changed. Therefore, in order to identity the type and orientation of the document and edit and process the image that is to be reproduced on copy paper based on the result of said identification, these processes needed to be performed prior to coding of the image data or after the decoding process.
One of the image identification processes performed by the image processing device is identification of the orientation of the document. In this process to identify the orientation of the document, the orientation of the document is identified and the image is rotated such that the copy output is oriented correctly. For example, in the device disclosed in Japanese Laid-Open Patent Hei 4-229763, the orientation of the letter images is identified, based on which identification of the orientation of the document is performed. However, in this device, the process to identify the letter image is complex and time-consuming. Moreover, a large amount of memory is needed in order to store reference letters. This makes the device an unrealistic system, and poses problems in practical use.
In addition to the device described above, a device that determines the orientation of the image based on the locations of commas and periods has been proposed. Since this device, unlike the device described above that identifies the orientation of a letter image, does not require letter pattern matching, it is relatively more realistic, but because identification of commas and periods is performed using special circuits and software, it takes longer to perform processing. Further, a device that determines the orientation of the image based on the distribution of blank areas of the document has also been proposed. While the method of identification of the orientation based on the distribution of blank areas of the document is very easy, where both a letter image and a photographic image exist in the document image and where columnization and tabs are used in the letter image, the shapes of the blank areas are complex, and as a result the device is unable to perform accurate identification of the orientation of the image.
In a digital full-color copy machine, etc. in which coding via the JPEG method takes place, a memory with a large capacity is needed for the orientation identification process in order to store the image data prior to coding or after decoding. In addition, since the orientation identification process is carried out with regard to the image data saved in the large memory described above, there is a practical problem that a long calculation time is required.